package hz.mobileproject.pda.ui.view;

import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Display;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import org.xutils.x;

import hz.mobileproject.pda.R;

/**
 * Created by Lc on 2017/11/16.
 */

public class PhotoDialog extends Dialog implements View.OnClickListener {
    private Context mContext;
    private ImageView iv_photo;
    private FrameLayout rl_dialog;
    private String url;

    public PhotoDialog(Context context , String url) {
//        super(context, R.style.toumingDialog);
        super(context);
        this.mContext = context;
        this.url = url;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //去除title
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.layout_photo_dialog);
        setCanceledOnTouchOutside(true);

        iv_photo = (ImageView) findViewById(R.id.iv_photo_indialog);
        rl_dialog = (FrameLayout) findViewById(R.id.rl_dialog);
        rl_dialog.setOnClickListener(this);
        x.image().bind(iv_photo,url);
    }

    @Override
    public void onClick(View v) {
        this.dismiss();
    }
}
